package com.zzyy.study.controller;

import com.zzyy.study.resp.ResultData;
import com.zzyy.study.service.OrderService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @auther zzyy
 * @create 2024-01-13 18:05
 */
@RestController
@Slf4j
public class OrderController
{
    @Resource
    private OrderService orderService;

    @RequestMapping(value = "/order/add",method = RequestMethod.POST)
    public void addOrder()
    {
        orderService.addOrder();
    }

    @GetMapping(value = "/order/{id}")
    public String findUserById(@PathVariable("id") Integer id)
    {
        return orderService.getOrderById(id);
    }

    @GetMapping("/order/addOrderSwitch")
    public ResultData addOrderSwitch() {

        return orderService.addOrderSwitch();
    }
}
